import sys
import mindspore as ms

ms.set_context(device_target="CPU")

ckpt = sys.argv[1]
resume_keys = ["loss_scale", "epoch_num", "step_num", "global_batch_size", "global_step"]

params = ms.load_checkpoint(ckpt)
for k in params:
    if k not in resume_keys:
        print(k, ":", params[k], " ", params[k].shape)

for k in resume_keys:
    print(k, ":", params[k], " ", int(params[k]))
